package com.wechet.utils;

import com.wechet.domain.OrderMaster;
import com.wechet.dto.OrderDto;
import org.springframework.beans.BeanUtils;

import java.util.List;
import java.util.stream.Collectors;

/**
 * Created by sc on 2017/9/22.
 */
public class OrderMaster2OrderDTO {

    public static OrderDto convert(OrderMaster orderMaster){
        OrderDto orderDto = new OrderDto();
        BeanUtils.copyProperties(orderMaster,orderDto);
        return orderDto;
    }

    public static List<OrderDto> convert(List<OrderMaster> orderMasterList){
        return     orderMasterList.stream().map(e->convert(e)).collect((Collectors.toList()));
    }

}
